/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Tela;

import Bean.CadastroClienteBean;
import Dao.CadastroClienteDao;
import Dao.RelatoriosDAO;
import Utils.Relatorio;
import Utils.UtilInterface;
import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException;
import java.sql.SQLException;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author william
 */
public class CadastroCliente extends javax.swing.JFrame {

    private List<CadastroClienteBean> listacliente;
    private int id = 0;
    private boolean salvar = true;
    private String tipo = "nome";

    /**
     * Creates new form CadastroCliente
     */
    public CadastroCliente() {
        initComponents();
        setLocationRelativeTo(null);
        botoesInical();
        atualizarTabela();
    }

    public void botoesInical() {
        btnNovo.setEnabled(true);
        btnSalvar.setEnabled(false);
        btnAlterar.setEnabled(false);
       // btnExcluir.setEnabled(false);
        limpaCampos();
        bloqueiaCampos(false);
        atualizarTabela();
    }

    public void bloqueiaCampos(boolean opc) {
        txNome.setEnabled(opc);
        txPai.setEnabled(opc);
        txMae.setEnabled(opc);
        txRg.setEnabled(opc);
        txCpf.setEnabled(opc);
        cbSexo.setEnabled(opc);
        txforNascimento.setEnabled(opc);
        txNaturalidade.setEnabled(opc);
        cbEstadoCivil.setEnabled(opc);
        txBairro.setEnabled(opc);
        txCep.setEnabled(opc);
        txTelefone.setEnabled(opc);
        txNumero.setEnabled(opc);
        txCidade.setEnabled(opc);
        txCelular.setEnabled(opc);
        txEmail.setEnabled(opc);
        cbUf.setEnabled(opc);
        txEndereco.setEnabled(opc);
        cbEstado.setEnabled(opc);
    }

    public void limpaCampos() {
        txNome.setText(null);
        txPai.setText(null);
        txMae.setText(null);
        txRg.setText(null);
        txCpf.setText(null);
        cbSexo.setSelectedIndex(0);
        txforNascimento.setText(null);
        txNaturalidade.setText(null);
        cbEstadoCivil.setSelectedIndex(0);
        txBairro.setText(null);
        txCep.setText(null);
        txTelefone.setText(null);
        txNumero.setText(null);
        txCelular.setText(null);
        txEmail.setText(null);
        txCidade.setText(null);
        cbUf.setSelectedIndex(0);
        txEndereco.setText(null);
        cbEstado.setSelectedIndex(0);
    }

    private CadastroClienteBean retornaObejeto() {
        CadastroClienteBean pessoa = new CadastroClienteBean();
        pessoa.setNome(txNome.getText().trim());
        pessoa.setPai(txPai.getText().trim());
        pessoa.setMae(txMae.getText().trim());
       // pessoa.setNascimento(txforNascimento.getText().trim());
        pessoa.setNaturalidade(txNaturalidade.getText().trim());
      //  pessoa.setRg(txRg.getText().trim());
        pessoa.setCpf(txCpf.getText().trim());
        pessoa.setSexo(cbSexo.getSelectedItem().toString());
      //  pessoa.setEstadoCivil(cbEstadoCivil.getSelectedItem().toString());
      //  pessoa.setUf(cbUf.getSelectedItem().toString());

        pessoa.setCidade(txCidade.getText().trim());
        pessoa.setEndereco(txEndereco.getText().trim());
      //  pessoa.setNumeroCasa(txNumero.getText().trim());
        pessoa.setBairro(txBairro.getText().trim());
        pessoa.setCep(txCep.getText().trim());
       // pessoa.setCelular(txCelular.getText().trim());
        pessoa.setEmail(txEmail.getText().trim());
       // pessoa.setTelefone(txTelefone.getText().trim());
        pessoa.setEstado(cbEstado.getSelectedItem().toString());

        pessoa.setIdcliente(id);
        return pessoa;
    }

    public void atualizarTabela() {
        DefaultTableModel modelo = (DefaultTableModel) tblCliente.getModel();
        modelo.setNumRows(0);
        try {
            listacliente = CadastroClienteDao.getLista();
            for (CadastroClienteBean c : listacliente) {
                modelo.addRow(new Object[]{c.getNome(), c.getCpf()});
            }
        } catch (SQLException ex) {
            UtilInterface.msgErro("ERRO AO ATUALIZAR TABELA\n" + ex);
        }
    }

    private void preencheCampos() {
        CadastroClienteBean c = listacliente.get(tblCliente.getSelectedRow());
        id = c.getIdcliente();
        System.out.println(id);
        txNome.setText(c.getNome());
        txPai.setText(c.getPai());
        txMae.setText(c.getMae());
       // txforNascimento.setText(c.getNascimento());
        txNaturalidade.setText(c.getNaturalidade());
       // cbEstadoCivil.setSelectedItem(c.getEstadoCivil());
      // cbUf.setSelectedItem(c.getUf());
       // txRg.setText(c.getRg());
        txCpf.setText(c.getCpf());
        cbSexo.setSelectedItem(c.getSexo());
        txEndereco.setText(c.getEndereco());
        txBairro.setText(c.getBairro());
        txCidade.setText(c.getCidade());
        //txCelular.setText(c.getCelular());
        txEmail.setText(c.getEmail());
       // txNumero.setText(c.getNumero());
        txCep.setText(c.getCep());
        cbEstado.setSelectedItem(c.getEstado());
        bloqueiaCampos(false);
        btnNovo.setEnabled(true);
        btnSalvar.setEnabled(false);
        btnAlterar.setEnabled(true);
       // btnExcluir.setEnabled(true);
    }

    public static boolean validaCpf(String cpf) {
        boolean retorno = true;
        String cpfV = "";
        if (cpf.matches("^\\d{3}\\.\\d{3}\\.\\d{3}-\\d{2}$")) {
            try {
                cpf = cpf.replace(".", "");
                cpf = cpf.replace("-", "");

                for (int i = 0; i <= 9; i++) {
                    cpfV = "";

                    for (int j = 1; j <= 11; j++) {
                        cpfV += i;
                    }
                    if (cpfV.equals(cpf)) {
                        return false;
                    }
                }
                int digito[] = new int[11];
                int dvInformado = Integer.parseInt(cpf.substring(9, 11));
                for (int i = 0; i <= 8; i++) {
                    digito[i] = Integer.parseInt(cpf.substring(i, i + 1));
                }
                int posicao = 10;
                int soma = 0;
                for (int i = 0; i <= 8; i++) {
                    soma = (soma + digito[i] * posicao);
                    posicao = (posicao - 1);
                }
                digito[9] = (soma % 11);
                if (digito[9] < 2) {
                    digito[9] = 0;
                } else {
                    digito[9] = (11 - digito[9]);
                }
                posicao = 11;
                soma = 0;

                for (int i = 0; i <= 9; i++) {
                    soma = (soma + digito[i] * posicao);
                    posicao = (posicao - 1);
                }
                digito[10] = (soma % 11);
                if (digito[10] < 2) {
                    digito[10] = 0;
                } else {
                    digito[10] = (11 - digito[10]);
                }
                int dv = (digito[9] * 10 + digito[10]);
                if (dv != dvInformado) {
                    retorno = false;
                }
            } catch (Exception e) {
                retorno = false;

            }
        } else {
            retorno = false;
        }

        return retorno;
    }

    private boolean verificaCampos() {

        boolean v = true;


        if (txCpf.getText().equals("   .   .   -  ")) {
            txCpf.setBackground(UtilInterface.COR_ERRO);
        } else {
            txCpf.setBackground(UtilInterface.COR_SUCESSO);

        }

        if (!validaCpf(txCpf.getText())) {
            v = false;
            UtilInterface.msgErro("O CPF CONTINUA INVALIDO");
            txCpf.setBackground(UtilInterface.COR_ERRO);
            txCpf.requestFocus();
        }
        if (salvar == true) {
            for (CadastroClienteBean c : listacliente) {
                if (txCpf.getText().equals(c.getCpf())) {
                    v = false;
                    UtilInterface.msgErro("CPF já cadastrado");
                }
            }
        }

        if (txNome.getText().trim().equals("")) {
            v = false;
            txNome.setBackground(UtilInterface.COR_ERRO);
        } else {
            txNome.setBackground(UtilInterface.COR_SUCESSO);
        }
        if (txforNascimento.getText().equals("  /  /    ")) {
            v = false;
            txforNascimento.setBackground(UtilInterface.COR_ERRO);
        } else {
            txforNascimento.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txNaturalidade.getText().trim().equals("")) {
            v = false;
            txNaturalidade.setBackground(UtilInterface.COR_ERRO);
        } else {
            txNaturalidade.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txRg.getText().trim().equals("")) {
            v = false;
            txRg.setBackground(UtilInterface.COR_ERRO);
        } else {
            txRg.setBackground(UtilInterface.COR_SUCESSO);
        }


        if (cbSexo.getSelectedIndex() == 0) {
            v = false;
            cbSexo.setBackground(UtilInterface.COR_ERRO);
        } else {
            cbSexo.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (cbEstadoCivil.getSelectedIndex() == 0) {
            v = false;
            cbEstadoCivil.setBackground(UtilInterface.COR_ERRO);
        } else {
            cbEstadoCivil.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (cbUf.getSelectedIndex() == 0) {
            v = false;
            cbUf.setBackground(UtilInterface.COR_ERRO);
        } else {
            cbUf.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txEndereco.getText().trim().equals("")) {
            v = false;
            txEndereco.setBackground(UtilInterface.COR_ERRO);
        } else {
            txEndereco.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txBairro.getText().trim().equals("")) {
            v = false;
            txBairro.setBackground(UtilInterface.COR_ERRO);
        } else {
            txBairro.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txCidade.getText().trim().equals("")) {
            v = false;
            txCidade.setBackground(UtilInterface.COR_ERRO);
        } else {
            txCidade.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txCelular.getText().trim().equals("")) {
            v = false;
            txCelular.setBackground(UtilInterface.COR_ERRO);
        } else {
            txCelular.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txNumero.getText().trim().equals("")) {
            v = false;
            txNumero.setBackground(UtilInterface.COR_ERRO);
        } else {
            txNumero.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (txCep.getText().equals("     -   ")) {
            v = false;
            txCep.setBackground(UtilInterface.COR_ERRO);
        } else {
            txCep.setBackground(UtilInterface.COR_SUCESSO);
        }

        if (cbEstado.getSelectedIndex() == 0) {
            v = false;
            cbEstado.setBackground(UtilInterface.COR_ERRO);
        } else {
            cbEstado.setBackground(UtilInterface.COR_SUCESSO);
        }
        if (txCelular.getText().equals("(  )    -    ")) {
            v = false;
            txCelular.setBackground(UtilInterface.COR_ERRO);
        } else {
            txCelular.setBackground(UtilInterface.COR_SUCESSO);
        }


        if (!v) {
            Utils.UtilInterface.msgErro("PREENCHA OS CAMPOS OBRIGATORIOS DE FORMA CORRETA!");

        }
        return v;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        buttonGroup1 = new javax.swing.ButtonGroup();
        pCadastro = new javax.swing.JPanel();
        lbCadastro = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPDP = new javax.swing.JPanel();
        lbNome = new javax.swing.JLabel();
        lbPai = new javax.swing.JLabel();
        txPai = new javax.swing.JTextField();
        lbMae = new javax.swing.JLabel();
        txMae = new javax.swing.JTextField();
        lbCpf = new javax.swing.JLabel();
        lbRg = new javax.swing.JLabel();
        lbNascimento = new javax.swing.JLabel();
        lbNaturalidade = new javax.swing.JLabel();
        txNaturalidade = new javax.swing.JTextField();
        lbSexo = new javax.swing.JLabel();
        cbSexo = new javax.swing.JComboBox();
        lbUf = new javax.swing.JLabel();
        cbUf = new javax.swing.JComboBox();
        lbEstadoCivil = new javax.swing.JLabel();
        cbEstadoCivil = new javax.swing.JComboBox();
        txforNascimento = new javax.swing.JFormattedTextField();
        txRg = new javax.swing.JFormattedTextField();
        txNome = new javax.swing.JFormattedTextField();
        txCpf = new javax.swing.JFormattedTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        lbEstadoCivil1 = new javax.swing.JLabel();
        cbUf1 = new javax.swing.JComboBox();
        jPDC = new javax.swing.JPanel();
        lbEndereco = new javax.swing.JLabel();
        lbBairro = new javax.swing.JLabel();
        txBairro = new javax.swing.JTextField();
        lbNumero = new javax.swing.JLabel();
        txEndereco = new javax.swing.JTextField();
        lbCidade = new javax.swing.JLabel();
        txCidade = new javax.swing.JTextField();
        lbEstado = new javax.swing.JLabel();
        cbEstado = new javax.swing.JComboBox();
        lbCelular = new javax.swing.JLabel();
        lbTelefone = new javax.swing.JLabel();
        lbCep = new javax.swing.JLabel();
        blEmail = new javax.swing.JLabel();
        txEmail = new javax.swing.JTextField();
        txCelular = new javax.swing.JFormattedTextField();
        txCep = new javax.swing.JFormattedTextField();
        txTelefone = new javax.swing.JFormattedTextField();
        txNumero = new javax.swing.JFormattedTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        pBotoes = new javax.swing.JPanel();
        btnNovo = new javax.swing.JButton();
        btnSalvar = new javax.swing.JButton();
        btnAlterar = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblCliente = new javax.swing.JTable();
        jButton1 = new javax.swing.JButton();
        txpesquisa = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setBackground(new java.awt.Color(0, 0, 0));
        setForeground(new java.awt.Color(0, 0, 204));
        setResizable(false);

        lbCadastro.setFont(new java.awt.Font("Script MT Bold", 1, 36));
        lbCadastro.setText("Cadastro de Cliente ");
        lbCadastro.setToolTipText("");

        javax.swing.GroupLayout pCadastroLayout = new javax.swing.GroupLayout(pCadastro);
        pCadastro.setLayout(pCadastroLayout);
        pCadastroLayout.setHorizontalGroup(
            pCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 652, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pCadastroLayout.createSequentialGroup()
                .addContainerGap(181, Short.MAX_VALUE)
                .addComponent(lbCadastro)
                .addGap(147, 147, 147))
        );
        pCadastroLayout.setVerticalGroup(
            pCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pCadastroLayout.createSequentialGroup()
                .addComponent(lbCadastro)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 11, Short.MAX_VALUE))
        );

        jPDP.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        lbNome.setText("NOME:");

        lbPai.setText("PAI:");

        txPai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txPaiActionPerformed(evt);
            }
        });
        txPai.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txPaiFocusLost(evt);
            }
        });
        txPai.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txPaiKeyTyped(evt);
            }
        });

        lbMae.setText("MÃE:");

        txMae.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txMaeActionPerformed(evt);
            }
        });
        txMae.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txMaeFocusLost(evt);
            }
        });
        txMae.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txMaeKeyTyped(evt);
            }
        });

        lbCpf.setText("CPF:");

        lbRg.setText("RG:");

        lbNascimento.setText("NASCIMENTO:");

        lbNaturalidade.setText("NATURALIDADE:");

        txNaturalidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txNaturalidadeActionPerformed(evt);
            }
        });
        txNaturalidade.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txNaturalidadeFocusLost(evt);
            }
        });
        txNaturalidade.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txNaturalidadeKeyTyped(evt);
            }
        });

        lbSexo.setText("SEXO:");

        cbSexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SELECIONAR", "MASCULINO", "FEMININO" }));
        cbSexo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbSexoActionPerformed(evt);
            }
        });

        lbUf.setText("UF:");

        cbUf.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SELECIONAR", "ACRE", "ALAGOAS", "AMAPÁ", "AMAZONAS", "BAHIA", "CEARÁ", "DISTRITO FEDERAL", "ESPÍRITO SANTO", "GOIÁS", "MARANHÃO", "MATO GROSSO", "MATO GROSSO DO SUL", "MINAS GERAIS", "PARÁ", "PARAÍBA", "PARANÁ", "PERNAMBUCO", "PIAUÍ", "RIO DE JANEIRO", "RIO GRANDE DO NORTE", "RIO GRANDE DO SUL", "RONDÔNIA", "RORAIMA", "SANTA CATARINA", "SÃO PAULO", "SERGIPE", "TOCANTINS" }));
        cbUf.setToolTipText("escolha o estado de nascimento");

        lbEstadoCivil.setText("ESTADO CIVIL:");

        cbEstadoCivil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SELECIONAR", "SOLTEIRO", "CASADO", "VIUVO", "DIVORCIADO", "AMASIADO" }));

        try {
            txforNascimento.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        txRg.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        txRg.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txRgKeyTyped(evt);
            }
        });

        txNome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txNomeActionPerformed(evt);
            }
        });
        txNome.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txNomeFocusLost(evt);
            }
        });
        txNome.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txNomeKeyTyped(evt);
            }
        });

        try {
            txCpf.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txCpf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txCpfActionPerformed(evt);
            }
        });
        txCpf.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txCpfFocusLost(evt);
            }
        });

        jLabel1.setForeground(new java.awt.Color(255, 0, 0));
        jLabel1.setText("*");

        jLabel2.setForeground(new java.awt.Color(255, 0, 0));
        jLabel2.setText("*");

        jLabel3.setForeground(new java.awt.Color(255, 0, 0));
        jLabel3.setText("*");

        jLabel4.setForeground(new java.awt.Color(255, 0, 0));
        jLabel4.setText("*");

        jLabel5.setForeground(new java.awt.Color(255, 0, 0));
        jLabel5.setText("*");

        jLabel6.setForeground(new java.awt.Color(255, 0, 0));
        jLabel6.setText("*");

        jLabel7.setForeground(new java.awt.Color(255, 0, 0));
        jLabel7.setText("*");

        jLabel8.setForeground(new java.awt.Color(255, 0, 0));
        jLabel8.setText("*");

        lbEstadoCivil1.setText("STATUS");

        cbUf1.setForeground(new java.awt.Color(51, 204, 0));
        cbUf1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "ATIVO", "INATIVO" }));
        cbUf1.setToolTipText("escolha o estado de nascimento");

        javax.swing.GroupLayout jPDPLayout = new javax.swing.GroupLayout(jPDP);
        jPDP.setLayout(jPDPLayout);
        jPDPLayout.setHorizontalGroup(
            jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPDPLayout.createSequentialGroup()
                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPDPLayout.createSequentialGroup()
                        .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPDPLayout.createSequentialGroup()
                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lbPai, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbNome, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(lbMae, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txNome, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txPai, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(txMae, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPDPLayout.createSequentialGroup()
                                    .addGap(47, 47, 47)
                                    .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPDPLayout.createSequentialGroup()
                                            .addComponent(txforNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(lbEstadoCivil)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cbEstadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addComponent(txNaturalidade))))))
                    .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPDPLayout.createSequentialGroup()
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(lbNascimento, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPDPLayout.createSequentialGroup()
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(lbNaturalidade))))
                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPDPLayout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPDPLayout.createSequentialGroup()
                                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lbUf)
                                    .addComponent(lbSexo)))
                            .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(jPDPLayout.createSequentialGroup()
                                    .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lbCpf))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPDPLayout.createSequentialGroup()
                                    .addComponent(jLabel5)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lbRg, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txCpf)
                            .addComponent(txRg)
                            .addComponent(cbUf, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                            .addComponent(cbSexo, javax.swing.GroupLayout.Alignment.LEADING, 0, 119, Short.MAX_VALUE)))
                    .addGroup(jPDPLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbEstadoCivil1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cbUf1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(10, 10, 10))
        );
        jPDPLayout.setVerticalGroup(
            jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPDPLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPDPLayout.createSequentialGroup()
                        .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbNome)
                            .addComponent(lbRg)
                            .addComponent(txNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel5))
                        .addGap(18, 18, 18)
                        .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbPai)
                            .addComponent(txPai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbCpf)
                            .addComponent(txCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addGap(18, 18, 18)
                        .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPDPLayout.createSequentialGroup()
                                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(lbMae, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txMae, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel2)
                                    .addComponent(lbUf)
                                    .addComponent(lbNaturalidade)
                                    .addComponent(txNaturalidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cbUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel8))
                                .addGap(18, 18, 18)
                                .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel3)
                                    .addComponent(lbNascimento)
                                    .addComponent(txforNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbEstadoCivil)
                                    .addComponent(cbEstadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4)
                                    .addComponent(cbUf1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbEstadoCivil1)))
                            .addGroup(jPDPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(lbSexo)
                                .addComponent(cbSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel7)))))
                .addContainerGap(44, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("DADOS PRINCIPAIS", jPDP);

        jPDC.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPDC.setForeground(new java.awt.Color(255, 0, 0));

        lbEndereco.setText("ENDEREÇO:");

        lbBairro.setText("BAIRRO:");

        txBairro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txBairroActionPerformed(evt);
            }
        });
        txBairro.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txBairroFocusLost(evt);
            }
        });
        txBairro.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txBairroKeyTyped(evt);
            }
        });

        lbNumero.setText("NUMERO:");

        txEndereco.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txEnderecoFocusLost(evt);
            }
        });
        txEndereco.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txEnderecoKeyTyped(evt);
            }
        });

        lbCidade.setText("CIDADE:");

        txCidade.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txCidadeFocusLost(evt);
            }
        });
        txCidade.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txCidadeKeyTyped(evt);
            }
        });

        lbEstado.setText("ESTADO:");

        cbEstado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SELECIONAR", "ACRE", "ALAGOAS", "AMAPÁ", "AMAZONAS", "BAHIA", "CEARÁ", "DISTRITO FEDERAL", "ESPÍRITO SANTO", "GOIÁS", "MARANHÃO", "MATO GROSSO", "MATO GROSSO DO SUL", "MINAS GERAIS", "PARÁ", "PARAÍBA", "PARANÁ", "PERNAMBUCO", "PIAUÍ", "RIO DE JANEIRO", "RIO GRANDE DO NORTE", "RIO GRANDE DO SUL", "RONDÔNIA", "RORAIMA", "SANTA CATARINA", "SÃO PAULO", "SERGIPE", "TOCANTINS" }));

        lbCelular.setText("CELULAR:");

        lbTelefone.setText("TELEFONE:");

        lbCep.setText("CEP:");

        blEmail.setText("EMAIL:");

        txEmail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txEmailActionPerformed(evt);
            }
        });
        txEmail.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txEmailKeyTyped(evt);
            }
        });

        try {
            txCelular.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        try {
            txCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txCep.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txCepActionPerformed(evt);
            }
        });

        try {
            txTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        txNumero.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        txNumero.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txNumeroKeyTyped(evt);
            }
        });

        jLabel9.setForeground(new java.awt.Color(255, 0, 0));
        jLabel9.setText("*");

        jLabel10.setForeground(new java.awt.Color(255, 0, 0));
        jLabel10.setText("*");

        jLabel12.setForeground(new java.awt.Color(255, 0, 0));
        jLabel12.setText("*");

        jLabel13.setForeground(new java.awt.Color(255, 0, 0));
        jLabel13.setText("*");

        jLabel14.setForeground(new java.awt.Color(255, 0, 0));
        jLabel14.setText("*");

        jLabel15.setForeground(new java.awt.Color(255, 0, 0));
        jLabel15.setText("*");

        jLabel16.setForeground(new java.awt.Color(255, 0, 0));
        jLabel16.setText("*");

        javax.swing.GroupLayout jPDCLayout = new javax.swing.GroupLayout(jPDC);
        jPDC.setLayout(jPDCLayout);
        jPDCLayout.setHorizontalGroup(
            jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPDCLayout.createSequentialGroup()
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPDCLayout.createSequentialGroup()
                        .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 10, Short.MAX_VALUE)
                        .addGap(2, 2, 2))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPDCLayout.createSequentialGroup()
                        .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPDCLayout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel13)
                                    .addComponent(jLabel12))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbEndereco)
                    .addComponent(lbCelular)
                    .addComponent(lbBairro)
                    .addComponent(blEmail)
                    .addComponent(lbCidade))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPDCLayout.createSequentialGroup()
                        .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txEndereco, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE)
                            .addComponent(txBairro)
                            .addComponent(txCidade)
                            .addComponent(txEmail))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 113, Short.MAX_VALUE)
                        .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.TRAILING)))
                    .addComponent(txCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPDCLayout.createSequentialGroup()
                        .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbTelefone, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPDCLayout.createSequentialGroup()
                                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lbCep)
                                    .addComponent(lbEstado))
                                .addGap(10, 10, 10)))
                        .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPDCLayout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addComponent(txCep, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPDCLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(cbEstado, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txTelefone)))))
                    .addGroup(jPDCLayout.createSequentialGroup()
                        .addComponent(lbNumero)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txNumero, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(21, 21, 21))
        );
        jPDCLayout.setVerticalGroup(
            jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPDCLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbEndereco)
                    .addComponent(lbNumero)
                    .addComponent(txEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txNumero)
                    .addComponent(jLabel9)
                    .addComponent(jLabel14))
                .addGap(18, 18, 18)
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbBairro)
                    .addComponent(lbCep)
                    .addComponent(txBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(jLabel15))
                .addGap(16, 16, 16)
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbCidade)
                    .addComponent(lbEstado)
                    .addComponent(cbEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)
                    .addComponent(jLabel16))
                .addGap(18, 18, 18)
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lbCelular)
                        .addComponent(lbTelefone)
                        .addComponent(txTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel13)))
                .addGap(18, 18, 18)
                .addGroup(jPDCLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(blEmail)
                    .addComponent(txEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(53, 53, 53))
        );

        jTabbedPane1.addTab("DADOS COMPLEMENTARES", jPDC);

        pBotoes.setBackground(new java.awt.Color(204, 204, 204));
        pBotoes.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        pBotoes.setForeground(new java.awt.Color(51, 51, 255));

        btnNovo.setFont(new java.awt.Font("Tempus Sans ITC", 1, 14));
        btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Add.png"))); // NOI18N
        btnNovo.setText("NOVO");
        btnNovo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNovoActionPerformed(evt);
            }
        });
        pBotoes.add(btnNovo);

        btnSalvar.setFont(new java.awt.Font("Tempus Sans ITC", 1, 14));
        btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Save.png"))); // NOI18N
        btnSalvar.setText("SALVAR");
        btnSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalvarActionPerformed(evt);
            }
        });
        pBotoes.add(btnSalvar);

        btnAlterar.setFont(new java.awt.Font("Tempus Sans ITC", 1, 14));
        btnAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Modify.png"))); // NOI18N
        btnAlterar.setText("ALTERAR");
        btnAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAlterarActionPerformed(evt);
            }
        });
        pBotoes.add(btnAlterar);

        tblCliente.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        tblCliente.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "NOME", "CPF"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblCliente.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblClienteMouseClicked(evt);
            }
        });
        tblCliente.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tblClienteKeyReleased(evt);
            }
        });
        jScrollPane2.setViewportView(tblCliente);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/View.png"))); // NOI18N
        jButton1.setText("Pesquisar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        txpesquisa.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txpesquisaKeyReleased(evt);
            }
        });

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel18.setText("Pesquisar:");

        jLabel19.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel19.setText("Pesquisar por");

        buttonGroup1.add(jRadioButton1);
        jRadioButton1.setFont(new java.awt.Font("Tahoma", 0, 14));
        jRadioButton1.setSelected(true);
        jRadioButton1.setText("Nome");
        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton1ActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioButton2);
        jRadioButton2.setFont(new java.awt.Font("Tahoma", 0, 14));
        jRadioButton2.setText("CPF");
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton2ActionPerformed(evt);
            }
        });

        jLabel29.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel29.setText("Campos Obrigatorios");

        jLabel30.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel30.setForeground(new java.awt.Color(255, 0, 51));
        jLabel30.setText("*");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pCadastro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 652, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 632, Short.MAX_VALUE)
                    .addComponent(pBotoes, javax.swing.GroupLayout.DEFAULT_SIZE, 632, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel18)
                            .addComponent(jLabel19))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jRadioButton1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jRadioButton2)
                                .addGap(0, 436, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(txpesquisa, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton1)
                                .addGap(109, 109, 109))))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 632, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel30)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel29)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(pCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton1)
                    .addComponent(jRadioButton2)
                    .addComponent(jLabel19))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(txpesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(jLabel29)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txPaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txPaiActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txPaiActionPerformed

    private void txMaeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txMaeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txMaeActionPerformed

    private void txNaturalidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txNaturalidadeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txNaturalidadeActionPerformed

    private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed
       btnNovo.setEnabled(false);
        //btnExcluir.setEnabled(false);
        btnSalvar.setEnabled(true);
        btnAlterar.setEnabled(false);
        limpaCampos();
        bloqueiaCampos(true);
        txNome.requestFocus();
        salvar = true;
        
         
    }//GEN-LAST:event_btnNovoActionPerformed

    private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed
        if (verificaCampos()) {
            if (salvar) {
                try {
                    CadastroClienteDao.salvar(retornaObejeto());
                    atualizarTabela();
                    UtilInterface.msqSucesso(UtilInterface.MSG_SUC_SALVAR);
                    botoesInical();
                } catch (SQLException e) {
                    UtilInterface.msgErro("Erro ao Salvar\n" + e);
                }
            } else {
                try {
                    CadastroClienteDao.alterar(retornaObejeto());
                    atualizarTabela();
                    UtilInterface.msqSucesso(UtilInterface.MSG_SUC_ALTERAR);
                    botoesInical();
                } catch (SQLException e) {
                    UtilInterface.msgErro("Erro ao Alterar\n" + e);
                }
            }
        }
    }//GEN-LAST:event_btnSalvarActionPerformed

    private void txNomeFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txNomeFocusLost
        txNome.setText(txNome.getText().toUpperCase());
    }//GEN-LAST:event_txNomeFocusLost

    private void txPaiFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txPaiFocusLost
        txPai.setText(txPai.getText().toUpperCase());
    }//GEN-LAST:event_txPaiFocusLost

    private void txMaeFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txMaeFocusLost
        txMae.setText(txMae.getText().toUpperCase());
    }//GEN-LAST:event_txMaeFocusLost

    private void txNaturalidadeFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txNaturalidadeFocusLost
        txNaturalidade.setText(txNaturalidade.getText().toUpperCase());
    }//GEN-LAST:event_txNaturalidadeFocusLost

    private void txCepActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txCepActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txCepActionPerformed

    private void txEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txEmailActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txEmailActionPerformed

    private void txCidadeFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txCidadeFocusLost
        txCidade.setText(txCidade.getText().toUpperCase());
    }//GEN-LAST:event_txCidadeFocusLost

    private void txEnderecoFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txEnderecoFocusLost
        txEndereco.setText(txEndereco.getText().toUpperCase());
    }//GEN-LAST:event_txEnderecoFocusLost

    private void txBairroFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txBairroFocusLost
        txBairro.setText(txBairro.getText().toUpperCase());
    }//GEN-LAST:event_txBairroFocusLost

    private void txBairroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txBairroActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txBairroActionPerformed

    private void btnAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAlterarActionPerformed
        salvar = false;
        bloqueiaCampos(true);
        btnNovo.setEnabled(false);
        btnSalvar.setEnabled(true);
        btnAlterar.setEnabled(false);
       // btnExcluir.setEnabled(false);
    }//GEN-LAST:event_btnAlterarActionPerformed

    private void tblClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblClienteMouseClicked
        preencheCampos();
    }//GEN-LAST:event_tblClienteMouseClicked

    private void tblClienteKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tblClienteKeyReleased
        preencheCampos();   // TODO add your handling code here:
    }//GEN-LAST:event_tblClienteKeyReleased

    private void txNomeKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txNomeKeyTyped
        if (txNome.getText().length() > 55) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!\n Por favor abrevie");
        }
    }//GEN-LAST:event_txNomeKeyTyped

    private void txNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txNomeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txNomeActionPerformed

    private void txPaiKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txPaiKeyTyped
        if (txPai.getText().length() > 55) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!\n Por favor abrevie");
        }

    }//GEN-LAST:event_txPaiKeyTyped

    private void txMaeKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txMaeKeyTyped
        if (txMae.getText().length() > 55) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!\n Por favor abrevie");
        }
    }//GEN-LAST:event_txMaeKeyTyped

    private void txRgKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txRgKeyTyped
        if (txRg.getText().length() > 10) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!");
        }
    }//GEN-LAST:event_txRgKeyTyped

    private void txNaturalidadeKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txNaturalidadeKeyTyped
        if (txNaturalidade.getText().length() > 50) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!\n Por favor abrevie");
        }
    }//GEN-LAST:event_txNaturalidadeKeyTyped

    private void txEnderecoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txEnderecoKeyTyped
        if (txEndereco.getText().length() > 55) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!\n Por favor abrevie");
        }
    }//GEN-LAST:event_txEnderecoKeyTyped

    private void txBairroKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txBairroKeyTyped
        if (txBairro.getText().length() > 55) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!\n Por favor abrevie");
        }
    }//GEN-LAST:event_txBairroKeyTyped

    private void txCidadeKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txCidadeKeyTyped
        if (txCidade.getText().length() > 55) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!\n Por favor abrevie");
        }
    }//GEN-LAST:event_txCidadeKeyTyped

    private void txEmailKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txEmailKeyTyped
        if (txEmail.getText().length() > 55) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!");
        }
    }//GEN-LAST:event_txEmailKeyTyped

    private void txNumeroKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txNumeroKeyTyped
        if (txNumero.getText().length() > 7) {
            UtilInterface.msgErro("Voce atingiu o limite de caracteres!");
        }
    }//GEN-LAST:event_txNumeroKeyTyped

    private void cbSexoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSexoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cbSexoActionPerformed

    private void txCpfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txCpfActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txCpfActionPerformed

    private void txCpfFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txCpfFocusLost
        if (!validaCpf(txCpf.getText())) {
            UtilInterface.msgErro("CPF INVALIDO");
            txCpf.setBackground(UtilInterface.COR_ERRO);
        }
    }//GEN-LAST:event_txCpfFocusLost

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        if (!txpesquisa.getText().trim().isEmpty()) {
            atualizarTabelapesquisa();
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        tipo = "nome";
    }//GEN-LAST:event_jRadioButton1ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        tipo = "cliente";
    }//GEN-LAST:event_jRadioButton2ActionPerformed

private void txpesquisaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txpesquisaKeyReleased
        if (txpesquisa.getText().trim().isEmpty()) {
            atualizarTabela();
        }
}//GEN-LAST:event_txpesquisaKeyReleased

    private void atualizarTabelapesquisa() {
        DefaultTableModel modelo = (DefaultTableModel) tblCliente.getModel();
        modelo.setNumRows(0);
        try {
            listacliente = CadastroClienteDao.getLista(tipo, txpesquisa.getText());
            for (CadastroClienteBean c : listacliente) {
                modelo.addRow(new Object[]{c.getNome(), c.getCpf()});
            }
        } catch (SQLException ex) {
            UtilInterface.msgErro("ERRO AO ATUALIZAR TABELA\n" + ex);
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new CadastroCliente().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel blEmail;
    private javax.swing.JButton btnAlterar;
    private javax.swing.JButton btnNovo;
    private javax.swing.JButton btnSalvar;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JComboBox cbEstado;
    private javax.swing.JComboBox cbEstadoCivil;
    private javax.swing.JComboBox cbSexo;
    private javax.swing.JComboBox cbUf;
    private javax.swing.JComboBox cbUf1;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPDC;
    private javax.swing.JPanel jPDP;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lbBairro;
    private javax.swing.JLabel lbCadastro;
    private javax.swing.JLabel lbCelular;
    private javax.swing.JLabel lbCep;
    private javax.swing.JLabel lbCidade;
    private javax.swing.JLabel lbCpf;
    private javax.swing.JLabel lbEndereco;
    private javax.swing.JLabel lbEstado;
    private javax.swing.JLabel lbEstadoCivil;
    private javax.swing.JLabel lbEstadoCivil1;
    private javax.swing.JLabel lbMae;
    private javax.swing.JLabel lbNascimento;
    private javax.swing.JLabel lbNaturalidade;
    private javax.swing.JLabel lbNome;
    private javax.swing.JLabel lbNumero;
    private javax.swing.JLabel lbPai;
    private javax.swing.JLabel lbRg;
    private javax.swing.JLabel lbSexo;
    private javax.swing.JLabel lbTelefone;
    private javax.swing.JLabel lbUf;
    private javax.swing.JPanel pBotoes;
    private javax.swing.JPanel pCadastro;
    private javax.swing.JTable tblCliente;
    private javax.swing.JTextField txBairro;
    private javax.swing.JFormattedTextField txCelular;
    private javax.swing.JFormattedTextField txCep;
    private javax.swing.JTextField txCidade;
    private javax.swing.JFormattedTextField txCpf;
    private javax.swing.JTextField txEmail;
    private javax.swing.JTextField txEndereco;
    private javax.swing.JTextField txMae;
    private javax.swing.JTextField txNaturalidade;
    private javax.swing.JFormattedTextField txNome;
    private javax.swing.JFormattedTextField txNumero;
    private javax.swing.JTextField txPai;
    private javax.swing.JFormattedTextField txRg;
    private javax.swing.JFormattedTextField txTelefone;
    private javax.swing.JFormattedTextField txforNascimento;
    private javax.swing.JTextField txpesquisa;
    // End of variables declaration//GEN-END:variables
}
